import request from '@/utils/request'

// 查询送货单主表列表
export function listDelivery(query) {
  return request({
    url: '/test/delivery/list',
    method: 'get',
    params: query
  })
}

// 查询送货单主表详细
export function getDelivery(deliveryId) {
  return request({
    url: '/test/delivery/' + deliveryId,
    method: 'get'
  })
}

// 新增送货单主表
export function addDelivery(data) {
  return request({
    url: '/test/delivery',
    method: 'post',
    data: data
  })
}

// 修改送货单主表
export function updateDelivery(data) {
  return request({
    url: '/test/delivery',
    method: 'put',
    data: data
  })
}

// 删除送货单主表
export function delDelivery(deliveryId) {
  return request({
    url: '/test/delivery/' + deliveryId,
    method: 'delete'
  })
}

// 更新送货状态
export function updateDeliveryStatus(data) {
  return request({
    url: '/test/delivery/status',
    method: 'put',
    data: data
  })
}

// 生成送货单编号
export function generateDeliveryNo() {
  return request({
    url: '/test/delivery/generateNo',
    method: 'get'
  })
}

// 导出送货单数据
export function exportDelivery(query) {
  return request({
    url: '/test/delivery/export',
    method: 'post',
    data: query
  })
}

// 查询送货单明细列表
export function listDeliveryDetail(deliveryId) {
  return request({
    url: '/test/deliveryDetail/list/' + deliveryId,
    method: 'get'
  })
}

// 查询送货单明细详细
export function getDeliveryDetail(detailId) {
  return request({
    url: '/test/deliveryDetail/' + detailId,
    method: 'get'
  })
}

// 新增送货单明细
export function addDeliveryDetail(data) {
  return request({
    url: '/test/deliveryDetail',
    method: 'post',
    data: data
  })
}

// 修改送货单明细
export function updateDeliveryDetail(data) {
  return request({
    url: '/test/deliveryDetail',
    method: 'put',
    data: data
  })
}

// 删除送货单明细
export function delDeliveryDetail(detailId) {
  return request({
    url: '/test/deliveryDetail/' + detailId,
    method: 'delete'
  })
} 